package demo2;

import java.util.Comparator;

public class ScoreComparator implements Comparator<Person> {
    @Override
    public int compare(Person o1, Person o2) {
        return(int) (o1.score-o2.score);//分数double类型，要强转，但不可能直接转，这样会有精度遗失，这样转只是为了简便而已
    }
}
